/**
 * Written by Timbot
 * V1.0, June 2007
 */
package com.as3.timbot.data.collections
{
	import com.as3.timbot.data.iterators.IIterator;
	import com.as3.timbot.data.collections.IIterable;
	import com.as3.timbot.data.iterators.ArrayIterator;
	import com.as3.timbot.data.iterators.ArrayReverseIterator;
	/**
	* Makes Collections iterable via an Iterator
	*/
	public class UIntCollection implements IIterable
	{
		private var _data:Array;
		
		public function UIntCollection()
		{
			_data = new Array();
		}
		/**
		*	Adds a Uint to the collection
		*
		*	@param value A Uint to add to collection
		*
		* 	@langversion ActionScript 3.0
		*	@playerversion Flash 9.0
		*	@tiptext
		*/
		public function addElement(value:uint):void
		{
			_data.push(value);
		}
		/**
		*	Returns an Iterator for the Uint collection
		*
		*	@param type Specify a forward or reverse iterator, default is forward
		*
		*	@returns IIterator
		*
		* 	@langversion ActionScript 3.0
		*	@playerversion Flash 9.0
		*	@tiptext
		*/
		public function iterator(type:String = null):IIterator
		{
			switch (type){
				case "ArrayReverseIterator":
				return new ArrayReverseIterator(_data);
				break;
				default:
				return new ArrayIterator(_data);
			}
		}
	}
}